package com.ftg.learn.day10.pattern.proxy;

/**
 * 代理类
 *
 * @author 布衣
 */
public class SingerProxy implements SingerInterface {

    private AbstractSinger abstractSinger;

    public SingerProxy(AbstractSinger a){
        this.abstractSinger = a;
    }

    //小丁  : ioc aop

    @Override
    public void singASong(String song) {
        long m1 = System.currentTimeMillis();

        System.out.println("大家好，我是谁，下面有请");
        //abstractSinger 目标类的父类    关注的方法
        abstractSinger.singASong(song);
        System.out.println("来交钱");
        long m2 = System.currentTimeMillis();

        System.out.println(m2 - m1);
    }
}
